package com.example.speeddating.service.impl;

import com.example.speeddating.entity.TagType;
import com.example.speeddating.mapper.TagTypeMapper;
import com.example.speeddating.service.TagTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.speeddating.service.TagsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:34
 */
@Service
public class TagTypeServiceImpl extends ServiceImpl<TagTypeMapper, TagType> implements TagTypeService {


    @Autowired
    public TagTypeMapper tagTypeMapper;

    @Override
    public List<TagType> allTagType() {
        return tagTypeMapper.selectList(null);
    }

    @Override
    public int deleteTagType(int typeId) {
        return tagTypeMapper.deleteById(typeId);
    }

    @Override
    public int updateTagType(TagType tagType) {
        return tagTypeMapper.update(tagType,null);
    }

    @Override
    public int insertTagType(TagType tagType) {
        return tagTypeMapper.insert(tagType);
    }
}
